/*
 * @Copyright: (C) 2019 Zhang Rida. All rights reserved.
 *
 * @Author: Zhang Rida
 * @Email: 215154317@qq.com
 * @FilePath: \WEILA_8910_PROJECT\Third-party\weilasdk\include\wl_types.h
 * @Date: 2021-02-18 15:07:07
 * @Description:type define for weila osal
 *
 * @LastEditors: Zhang Rida
 * @LastEditTime: 2021-05-21 10:36:26
 */
#ifndef _WL_TYPES_H
#define _WL_TYPES_H

#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#define UNUSED(x) (void)x

#define IN
#define OUT
#define INOUT

#define WL_MAX(x, y) ((x) >= (y) ? (x) : (y))
#define WL_MIN(x, y) ((x) >= (y) ? (y) : (x))

#define wl_null ((void*)0)
#define wl_true 1
#define wl_false 0

typedef char           wl_bool;
typedef char           wl_char;
typedef char           wl_int8;
typedef short          wl_int16;
typedef int            wl_int32;
typedef unsigned char  wl_uint8;
typedef unsigned char  wl_uchar;
typedef unsigned short wl_uint16;
typedef unsigned int   wl_uint32;
typedef size_t         wl_size;
typedef double         wl_double;
typedef float          wl_float;
typedef int            wl_ssize;
typedef long long      wl_int64;
typedef unsigned long long wl_uint64;


typedef enum { WL_RESULT_SUCCESS = 0, WL_RESULT_FAILURE = -1 } wl_result;

typedef struct __wl_timeval {
    long tv_sec;  /* seconds */
    long tv_usec; /* and microseconds */
} wl_timeval;

typedef wl_uint32 wl_time;

typedef struct {
    wl_int32 tm_sec;  /* 秒 0~59 */
    wl_int32 tm_min;  /* 分 0~59 */
    wl_int32 tm_hour; /* 小时 0~23 */
    wl_int32 tm_mday; /* 一月第几天 1~31 */
    wl_int32 tm_mon;  /* 月份 0~11 */
    wl_int32 tm_year; /* 年 1900起的年数 */
    wl_int32 tm_wday; /* 一周第几天 0~6 */
} wl_tm;

#define ZERO_CONTENT_SIZE 4

typedef void (*wl_trace_callback)(wl_char* buf);

typedef void (*wl_xip_callback)(void);

#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* _WL_TYPES_H */
